home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DBASE_UT / TPDB335 / PACKTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1993-11-26  |  2KB  |  59 lines

  1. {$A+,B+,D+,E-,F-,I-,L+,N-,O-,R-,S-,V-}
  2. {$M 16384,0,655360}
  3.  
  4. program PackTest;
  5.                            (***********************************)
  6.                            (*               TPDB              *)
  7.                            (***********************************)
  8.                            (*         Object -Oriented        *)
  9.                            (*    Borland/Turbo Pascal Units   *)
  10.                            (*    for Accessing dBASE III      *)
  11.                            (*             files.              *)
  12.                            (*      Copyright 1988 - 1993      *)
  13.                            (*          Brian Corll            *)
  14.                            (*       All Rights Reserved       *)
  15.                            (***********************************)
  16.                            (*            FREEWARE             *)
  17.                            (***********************************)
  18.                            (*     dBASE is a registered       *)
  19.                            (* trademark of Borland Int. Inc.  *)
  20.                            (*   Version 3.35  November, 1993  *)
  21.                            (***********************************)
  22.                            (*   Portions Copyright 1984,1991  *)
  23.                            (*    Borland International Corp.  *)
  24.                            (***********************************)
  25.  
  26. uses
  27.     Crt, TPDB;
  28.  
  29. var
  30.     H: integer;
  31.     Test:^DBF;
  32.  
  33.  
  34. begin
  35.     New(Test, Init('packtest.dbf'));
  36.     if Test^.TotalRecs >= 500 then
  37.         Test^.Zap;
  38.     ClrScr;
  39.     Writeln('Appending 1000 records.....');
  40.     Test^.FillRecs(1000);
  41.     Writeln('Deleting 500 records....');
  42.     for H := 1 to 1000 do begin
  43.         Test^.GetDBRec(H);
  44.         if H mod 2 = 0 then begin
  45.             Test^.Repl(1, 'Deleted.');
  46.             Test^.Mark;
  47.         end else
  48.             Test^.Repl(1, 'Undeleted.');
  49.         Test^.PutDBRec(H);
  50.     end;
  51.     Test^.DBReset;
  52.     Writeln('Packing....');
  53.     Test^.Pack;
  54.     Writeln('500 undeleted records remain.');
  55.     Writeln;
  56.     Writeln('TPDB Version 3.35');
  57.     Test^.Done;
  58. end.
  59.